<template>
    <div class="detail">
        <van-nav-bar title="订单详情" left-text="返回" left-arrow @click-left="onClickLeft" />
        <!-- 订单信息 -->
        <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa', padding: '0 16px' }">订单信息</van-divider>

        <viewOrderTemplate :dataResouce="pageDefaultList" :pageDataList="defaultLabelList"></viewOrderTemplate>

        <!-- 内容审核文件 -->
        <div class="auditFile">
            <van-cell :border="false">
                <template slot="icon">
                    <span class="custom-title" style="margin-right: 15px; width: 150px">内容审核文件：</span>
                    <div style="width: 100%">
                        <van-uploader 
                            v-if="false" 
                            :after-read="afterRead" :accept="'doc/docx'" 
                            :max-count="5" multiple>
                            <template slot="default">
                                <van-button type="primary" size="mini">上传文件</van-button>
                            </template>
                        </van-uploader>
                        <a v-for="file in details.review_file && details.review_file.indexOf('&') ? details.review_file.split('&') : details.review_file" :key="file"
                            :href="`${baseUrls}/api/download?path=${file}`">
                            <van-icon name="orders-o" size="22px" color="#2d8cf0"/>
                        </a>
                    </div>
                </template>
            </van-cell>
        </div>
    </div>
</template>

<script>
import viewOrderTemplate from '~/components/_viewOrder'

export default {
    data() {
        return {
            details: [],
            dataResouce: [],
            baseUrls: global.baseurl,
            defaultLabelList: ['代理人', '订单编号', '等待审核时间', '审核次数', '拟申报专利名称', '专利类型', '流程状态', '修改时间']
        }
    },
    created() {
        this.details = this.$store.state.orderDetailList
        this.pageDefaultList = [
            { label: '代理人', value: this.details.order_number },
            { label: '订单编号', value: this.details.patent_name },
            { label: '等待审核时间', value: this.details.liaisons_email },
            { label: '审核次数', value: this.details.liaisons_tel },
            { label: '拟申报专利名称', value: this.details.liaisons_tel },
            { label: '专利类型', value: this.details.liaisons_tel },
            { label: '流程状态', value: this.details.liaisons_tel },
            { label: '修改时间', value: this.details.liaisons_tel }
        ]
    },
    methods: {
        onClickLeft() {
            this.$router.go(-1);
        }
    },
    components: {
        viewOrderTemplate
    }
}
</script>

<style lang="less" scoped>
    .detail{
        .van-field__label{
            width: 100px;
        }
    }
</style>